<script>
export default {
  onLaunch: function () {
    console.log('App Launch');
    // 检查登录状态
    // this.checkLoginStatus();
  },
  onShow: function () {
    console.log('App Show');
  },
  onHide: function () {
    console.log('App Hide');
  },
  methods: {
    // checkLoginStatus() {
    //   const token = uni.getStorageSync('token');
    //   if (!token) {
    //     console.log('用户未登录');
    //   } else {
    //     console.log('用户已登录');
    //     // 可以在这里获取用户信息等操作
    //   }
    // }
  }
};
</script>

<style lang="scss">
@import '@tuniao/tn-style/dist/uniapp/index.css';

// 全局样式
page {
  background-color: $uni-bg-color-grey;
  font-family: 'Quicksand', 'PingFang SC', Arial, Helvetica, sans-serif;
}

view {
  box-sizing: border-box;
}

// 修改滚动条样式
::-webkit-scrollbar {
  width: 0;
  height: 0;
  background-color: transparent;
}

// 清除浮动
.clearfix::after {
  content: '';
  display: block;
  clear: both;
}

// 文本溢出省略
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 多行文本溢出省略
.text-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

// 浅彩像素风格全局样式
.pixel-border {
  position: relative;
  border: 4rpx solid #5c7c9f;

  &::after {
    content: '';
    position: absolute;
    top: -4rpx;
    left: -4rpx;
    right: -4rpx;
    bottom: -4rpx;
    z-index: -1;
    background: linear-gradient(45deg, #a3d2e6, #ffeedb);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
  }
}

// 柔光滤镜效果
.soft-light {
  position: relative;

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
  }
}

// 双层描边卡片
.pixel-card {
  position: relative;
  border-radius: $uni-border-radius-base;
  background-color: $uni-bg-color;
  padding: 20rpx;
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2rpx solid #ffffff;
    border-radius: calc($uni-border-radius-base - 2rpx);
    z-index: 0;
    pointer-events: none;
  }

  &::after {
    content: '';
    position: absolute;
    top: -1rpx;
    left: -1rpx;
    right: -1rpx;
    bottom: -1rpx;
    border: 1rpx solid rgba(163, 210, 230, 0.6);
    border-radius: $uni-border-radius-base;
    z-index: 0;
    pointer-events: none;
  }
}

// 主要颜色
.primary-color {
  color: $uni-color-primary;
}

// 渐变背景色
.gradient-bg {
  background: linear-gradient(135deg, #a3d2e6, #ffeedb);
}

// 页面容器通用样式
.page-container {
  min-height: 100vh;
  padding-bottom: 110rpx;
  background-color: $uni-bg-color-grey;
}

// 通用卡片样式
.common-card {
  background-color: $uni-bg-color;
  border-radius: $uni-border-radius-base;
  box-shadow: 0 4rpx 12rpx rgba(163, 210, 230, 0.2);
  margin-bottom: 20rpx;
  overflow: hidden;
  position: relative;

  &::after {
    content: '';
    position: absolute;
    top: -1rpx;
    left: -1rpx;
    right: -1rpx;
    bottom: -1rpx;
    border: 1rpx solid rgba(163, 210, 230, 0.4);
    border-radius: $uni-border-radius-base;
    z-index: 1;
    pointer-events: none;
  }
}

// 标题文字样式
.title-text {
  color: $uni-text-color-title;
  font-weight: 600;
}

// 正文文字样式
.content-text {
  color: $uni-text-color;
  line-height: 1.6;
}

// 辅助文字样式
.helper-text {
  color: $uni-text-color-grey;
  font-size: $uni-font-size-sm;
}

// 适配小程序底部安全区
.safe-area-inset-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

// 隐藏系统TabBar
.uni-tabbar {
  display: none !important;
}
</style>